<?php
class CreateCatalogForm extends CatalogForm
{
    public function configure()
    {
        $this->setWidgets(array(
                'name'              =>  new sfWidgetFormInput(),
                'is_active'         =>  new sfWidgetFormInputCheckbox(),
                'description'       =>  new sfWidgetFormTextarea(),
                'meta_title'        =>  new sfWidgetFormInput(),
                'meta_description'  =>  new sfWidgetFormInput(),
                'meta_keywords'     =>  new sfWidgetFormInput(),
            ));
        $this->setValidators(array(
                'name'              =>  new sfValidatorString(array('required' => true)),
                'is_active'         =>  new sfValidatorBoolean(array('required' => false)),
                'description'       =>  new sfValidatorString(array('required' => false)),
                'meta_title'        =>  new sfValidatorString(array('required' => false)),
                'meta_description'  =>  new sfValidatorString(array('required' => false)),
                'meta_keywords'     =>  new sfValidatorString(array('required' => false)),
            ));
        $this->widgetSchema->setNameFormat('create_category_form[%s]');
        $i18n = sfContext::getInstance()->getI18N(); 
        $this->widgetSchema->setLabels(array(
                'name'              =>  $i18n->__('Name'),
                'is_active'         =>  $i18n->__('Display'),
                'description'       =>  $i18n->__('Description'),
                'meta_title'        =>  $i18n->__('Meta Title'),
                'meta_description'  =>  $i18n->__('Meta Description'),
                'meta_keywords'     =>  $i18n->__('Meta Keywords'),
        ));
    }
}
?>